home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 1999-09-27 | 2.5 KB | 96 lines |
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "MakeProper"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
-
- Public Function RemoveFileExtension(Filename As String) As String
-
- If Filename = "" Then Exit Function
-
- For i = Len(Filename) To 1 Step -1
-
- If Mid(Filename, i, 1) = "." Then
- RemoveFileExtension = Mid(Filename, 1, i - 1)
- Exit Function
- End If
-
- RemoveFileExtension = Filename
-
- Next i
-
- End Function
- Public Function GetFileExtension(Filename As String) As String
-
- If Filename = "" Then Exit Function
-
- For i = 1 To Len(Filename)
-
- If Mid(Filename, i, 1) = "." Then
- GetFileExtension = Right(Filename, Len(Filename) - i)
- Exit Function
- End If
- Next i
-
- GetFileExtension = Filename
-
- End Function
- Public Function MakeFirstLetterUpperCase(Text As String) As String
-
- If Text = "" Then Exit Function
-
- MakeFirstLetterUpperCase = UCase(Left(Text, 1)) & Right(Text, (Len(Text) - 1))
-
- End Function
-
- Public Function MakeFirstLetterUpperCaseAllOthersLower(Text As String) As String
-
- If Text = "" Then Exit Function
-
- MakeFirstLetterUpperCaseAllOthersLower = (UCase(Left(Text, 1)) & LCase(Right(Text, (Len(Text) - 1))))
-
- End Function
-
- Public Function MakeAllFirstLettersCaptial(Text As String) As String
-
- If Text = "" Then Exit Function
-
- For i = 1 To Len(Text)
-
- If i = 1 Then Mid(Text, 1, 1) = UCase(Mid(Text, 1, 1)) 'Make sure that the first char is done
- If Mid(Text, i, 1) = " " Then
- Mid(Text, i + 1, 1) = UCase(Mid(Text, i + 1, 1))
- End If
-
- MakeAllFirstLettersCaptial = Text
-
- Next i
- End Function
-
-
- Public Function GetEmailServer(EmailAddress As String) As String
-
- If EmailAddress = "" Then Exit Function
-
- For i = Len(EmailAddress) To 1 Step -1
-
- If Mid(EmailAddress, i, 1) = "@" Then 'Get server
- GetEmailServer = Right(EmailAddress, Len(EmailAddress) - i)
- Exit Function
- End If
-
- Next i
-
- GetEmailServer = EmailAddress
-
- End Function
-
- Public Sub About()
-
- MsgBox "Make Proper v2 Class for Visual Basic." & Chr(13) & Chr(13) & Chr(34) & "If you dont like this code, stick it . . . " & Chr(34) & Chr(13) & Chr(13) & "N Ramsbottom ⌐1999", vbInformation, "About"
- End Sub
-